/*
 *  Menu.h
 *  pogostick
 *
 *  Created by daddy (chuck@kollar.com) on 8/26/09.
 *  Copyright 2009 Charles P. Kollar All rights reserved.
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#import "cocos2d.h"
#import <OpenGLES/ES1/gl.h>
#import <math.h>
#import "OpenGL_Internal.h"
#import "SimpleAudioEngine.h"

#import "common.h"

#define KEY_CURRENT_SCORE                @"MrPogoStick_currentScore"
#define KEY_LEVEL_NUMBER                 @"MrPogoStick_levelNumber"
#define KEY_AMULET_FOUND                 @"MrPogoStick_AmuletFound"
#define KEY_RESET_GAME_ON_PLAY           @"MrPogoStick_ResetGameOnPlay"


@class Menu;

@interface Layer1 : Layer
{
}

-(id) init;
-(void) dealloc;
-(void) menuCallbackPlay: (id) sender; //       GameLayer
-(void) menuCallbackSaveScore:(id) sender; //   SaveScoreLayer
-(void) menuCallbackHighScores:(id) sender; //  HighScoreLayer
-(void) menuCallbackAbout:(id) sender; //       About
-(void) menuCallbackConfigure: (id) sender; //  Layer4

@end


@interface Layer2 : Layer
{
}

-(void) menuCallbackBack: (id) sender;
-(void) menuCallbackOpacity: (id) sender;
-(void) menuCallbackAlign: (id) sender;

@end

enum nextAboutInstruction {
    gotoScreen,
    popScreen,
    restartGame
};

@interface AboutScreen : Layer
{
    Sprite *bg;
    Sprite *itemSprite;
}

@property (nonatomic, retain) Sprite *bg;
@property (nonatomic, retain) Sprite *itemSprite;

-(id) initWithScreenFileName:(NSString *)fn;
-(void) ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event nextAboutScreen:(AboutScreen *)nxt nextAboutInstruction:(enum nextAboutInstruction)ins;
-(void) dealloc;

@end

@interface About : AboutScreen
{
}

-(id) init;
-(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
@end

@interface About1 : AboutScreen
{
}

-(id) init;
-(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
@end

@interface About2 : AboutScreen
{
}

-(id) init;
-(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
@end

@interface About3 : AboutScreen
{
}

-(id) init;
-(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
@end

@interface About4 : AboutScreen
{
}

-(id) init;
-(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
@end

@interface NoMoreLives : AboutScreen
{
}

-(id) init;
-(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
@end

@interface YouWon : AboutScreen
{
}

-(id) init;
-(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
@end

@interface YouLost : AboutScreen
{
}

-(id) init;
-(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
@end


@interface AppController : NSObject <UIAccelerometerDelegate, UIAlertViewDelegate, UITextFieldDelegate, UIApplicationDelegate>
{
	UIWindow *window;
}

@property (nonatomic, retain) UIWindow *window;

@end


#import "cocoslive.h"

enum {
	kCategoryEasy = 0,
	kCategoryMedium = 1,
	kCategoryHard = 2,
};

enum {
	kAll = 0,
	kCountry = 1,
	kDevice = 2,
};


//
//Game Name: MrPogostick
// Type: int
//
// Score Fields: cc_playername, cc_score, cc_when
//http://www.cocoslive.net/game-scores?gamename=MrPogostick

#define GAME_NAME               @"MrPogostick"
#define GAME_KEY                @"c1116949e85a55cc2f4dfce5d39e537e"
#define GAME_CATEGORY           @"Classic"

#define GAME_DATA_FILE_NAME     @"gameData2.txt"


@interface SaveScoreLayer : Layer <UITextFieldDelegate, UITableViewDelegate, UITableViewDataSource, UIAlertViewDelegate>
{
	NSMutableDictionary *rootObj;
    NSMutableArray *localUsers;
}

@property (nonatomic, retain) NSMutableDictionary *rootObj;
@property (nonatomic, retain) NSMutableArray *localUsers;

@end


@interface HighScoreLayer : Layer <UITableViewDelegate, UITableViewDataSource>
{
	// scores category
	int			category;
	// scores world
	int			world;
	
    NSMutableArray *globalScores;
    UITableView *tableView;
}

@property (nonatomic, retain) NSMutableArray *globalScores;
@property (nonatomic, retain) UITableView *tableView;

@end

